import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Resetpwd from '../views/Resetpwd.vue'
import Wishlist from '../views/Wishlist.vue'
import Details from '../views/Details.vue'
import Checkout from '../views/Checkout.vue'
Vue.use(VueRouter)

const routes = [
  
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
  {
    path: '/resetpwd',
    name: 'Resetpwd',
    component: Resetpwd
  },
  {
    path: '/wishlist',
    name: 'Wishlist',
    component: Wishlist
  },
  {
    path: '/details',
    name: 'Details',
    component: Details
  },
  {
    path: '/checkout',
    name: 'Checkout',
    component: Checkout
  }
]

//实例化router
const router = new VueRouter({
  routes
})



export default router
//调用路由全局守卫

